Ignore non-existent .ui file dependencies
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 16 Apr 2020 17:05:12 +0000 (18:05 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 16 Apr 2020 17:05:12 +0000 (18:05 +0100)
Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=90779d96adfa51a3
Last-Update: 2019-11-05

Commit 80dea664 broke .ui files with global includes that are not part
of the project, because we blindly added every file path that falls
out of 'uic -d' as dependency.

Introduce the extra compiler CONFIG flag dep_existing_only to bring
back the old behavior that ignores non-existent dependencies and set
it for uic.

Gbp-Pq: Name uic_global_includes.diff

mkspecs/features/uic.prf
qmake/doc/src/qmake-manual.qdoc
qmake/generators/makefile.cpp

index 1cedce5ae7a33afce484f1c1ebe970631fac0b4e..a5df0c7e8d49506ac8547484cd825dad0ed94bee 100644 (file)
@@ -9,7 +9,7 @@ uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN}
 uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
 uic.input = FORMS
 uic.variable_out = GENERATED_FILES
-uic.CONFIG += no_link target_predeps dep_lines
+uic.CONFIG += no_link target_predeps dep_lines dep_existing_only
 uic.name = UIC ${QMAKE_FILE_IN}
 silent:uic.commands = @echo uic ${QMAKE_FILE_IN} && $$uic.commands
 QMAKE_EXTRA_COMPILERS += uic
index 2e2962f86c450af2709ff10f4c0faccf5cd3714c..cccf48a040087c497dfb23ffa833830ebe6977ca 100644 (file)
         \li explicit_dependencies
         \li The dependencies for the output only get generated from the depends
             member and from nowhere else.
+    \row
+        \li dep_existing_only
+        \li Every dependency that is a result of .depend_command is checked for
+            existence. Non-existing dependencies are ignored.
     \row
         \li dep_lines
         \li The output from the .depend_command is interpreted to be one file
index 11623cd147fa85462b1468408ede545d7fb6c8ed..fcd0ccd43e369c42aabada077ec78a0c1679a451 100644 (file)
@@ -1984,6 +1984,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
             }
             t << endl;
         }
+        const bool existingDepsOnly = config.contains("dep_existing_only");
         QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
         if (config.indexOf("combine") != -1) {
             if (tmp_out.contains(QRegExp("(^|[^$])\\$\\{QMAKE_(?!VAR_)"))) {
@@ -2025,6 +2026,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
                                             warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
                                                                      " prints paths relative to source directory",
                                                                      (*it).toLatin1().constData());
+                                        else if (existingDepsOnly)
+                                            file.clear();
                                         else
                                             file = absFile;  // fallback for generated resources
                                     } else {
@@ -2110,6 +2113,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
                                         warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
                                                                  " prints paths relative to source directory",
                                                                  (*it).toLatin1().constData());
+                                    else if (existingDepsOnly)
+                                        file.clear();
                                     else
                                         file = absFile;  // fallback for generated resources
                                 } else {